<div class="bm_new_nav_hr"><i class="bm_new_nav_hr_l"></i><i class="bm_new_nav_hr_r"></i></div>
<div class="bm_mac_nav2 ">
  <ul>
  	<li class="first"><a href="<?php echo scURL('document/index')?>">文章列表</a></li>
    <li class="last"><a href="<?php echo scURL('document/add')?>">增加文章</a></li>
  </ul>
  <div class="clearing"></div>
</div>

<div class="bm_wrap margin10">

	<div class="help_bbb">
		<form id="dataform" method="post" action="<?php echo scURL('document/doAdd')?>">
			<h2>添加文章</h2>
			<label for="subject">标题：</label>
			<input id="subject" name="subject" type="text" class="medium-input required" />
			<br/><br/>
			<textarea id="content" name="content" class="required"></textarea>
			<br/>
			<label for="subject">文章索引：</label>
			<input id="subject" name="subject" type="text" class="short-input required" style="width:100px"/>
			<br/><br/>
			<p style="text-align:center;margin:0 auto">
				<input type="submit" class="button" value="提交" />
				<input type="submit" class="button" value="预览文章" />
			</p>
			<div id="result"></div>
		</form>
	</div>
</div>


<script type="text/javascript" src="<?php echo __PUBLIC__?>/js/validation/jquery.validate.min.js"></script>
<script type="text/javascript" src="<?php echo __PUBLIC__?>/js/validation/lib/jquery.form.js"></script>
<script type="text/javascript" src="<?php echo __PUBLIC__?>/js/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
$(function() {
	var loader = jQuery('<div id="loader"><img src="<?php echo __PUBLIC__?>/image/loading.gif" alt="loading..." /></div>')
	.css({position: "relative", top: "1em", left: "25em"})
	.appendTo("body")
	.hide();
	
	$().ajaxStart(function() {
		loader.show();
	}).ajaxStop(function() {
		loader.hide();
	}).ajaxError(function(a, b, e) {
		throw e;
	});

	$("#dataform").validate({
		submitHandler: function(form) {
			jQuery(form).ajaxSubmit({
				target: "#result"
			});
		}
	});
	
	//CKEDITOR.replace('content');
	
	$('#subject').focus();
});
</script>